<template>
  <MenuNavigation />
  <div
    ref="exhibits16"
    class="jy-style-height cultural-box"
    id="exhibits-box-id"
    :style="{
      backgroundImage: `url(${publicUrls + 'free/style14/style14publicBg.png' + '?imageView2/3/format/webp'})`,
    }"
  >
    <div class="back-btn" @click="blankHome">
      <img :src="publicUrls + 'free/style14/style14BackIcon.png?imageView2/3/format/webp'" alt="" />
    </div>

    <div class="content-box">
      <div
        class="public-name"
        :style="{
          backgroundImage: `url(${publicUrls + 'free/style14/publicTitleBg.png' + '?imageView2/3/format/webp'})`,
        }"
      >
        <img :src="publicUrls + 'free/style14/publicName6.png?imageView2/3/format/webp'" alt="" />
      </div>
      <div class="comment-box">
        <comment text="发表评论" />
      </div>
      <div class="commentList-box">
        <div class="commentNum" v-if="total !== 0">共{{ total }}条留言</div>
        <div class="commentList-box-content">
          <ScrollBox
            color="rgba(50, 43, 37, 1)"
            :byid="4235"
            :height="getScrollWComputed"
            :tabbmScroll="getTabmComputed"
            :scroll-src="publicUrls + 'free/style14/scrollIcon.png'"
          >
            <template #solidBorderCon>
              <commentList
                @emitTotal="emitTotal"
                textColor="#56677B"
                bgColor="rgba(241, 239, 234, 0.50)"
                replyColor="#56677B"
              />
            </template>
            <template #solidBorderEx>
              <div class="solidBorder-child"></div>
            </template>
          </ScrollBox>
        </div>
      </div>
    </div>
    <div class="content-door">
      <i class="iconfonts">&#xe6dd;</i>
      <span>永不落幕的展览与展示平台</span>
    </div>
  </div>
</template>

<script lang="ts">
export default defineComponent({
  name: 'style14',
});
</script>
<script lang="ts" setup>
// @ts-nocheck
import { defineComponent, ref, computed, onMounted } from 'vue';
import comment from '../messageComponent/style14/comment.vue';
import commentList from '../messageComponent/style14/commentList.vue';
import { publicUrls, doorUrl } from '@/utils/minxin';
import { commonDataStore, useProjectStore } from '@/store';
const commonStore = commonDataStore();
import { useRouter, useRoute } from 'vue-router';
// import ScrollBox from '../scrollBox.vue';
import ScrollBox from '../scrollBox10.vue';
import MenuNavigation from '@/freeComponents/menuNavigation/index.vue';

const router = useRouter();
const route = useRoute();
const store = useProjectStore();
const total = ref(0);
const scrollheight = ref();
let viewportHeight = window.innerHeight;
scrollheight.value = viewportHeight * 0.33;
const blankHome = () => {
  // console.log('厨房大')
  //   store.menuId = null;
  router.push({ name: route.meta.loopType ? 'exhibitionHome' : 'templateedit' });
};
const emitTotal = (num: number) => {
  total.value = num;
};
const getScrollWComputed = computed(() => {
  let rootNode = document.documentElement;

  // 获取计算后的样式
  let computedStyle = window.getComputedStyle(rootNode);

  // 读取字体大小（注意这里返回的可能是一个包含单位的字符串，如"16px"）
  let fontSize = computedStyle.fontSize;

  // 如果你需要一个数字值（不带单位）进行计算，你可能需要解析这个字符串
  // 例如，使用正则表达式或split()方法去除单位，并将结果转换为数字
  let fontSizeNumber = parseFloat(fontSize.replace(/[^0-9.-]/g, ''));
  let heights = (fontSizeNumber / 144) * 338;
  return heights;
});
const getTabmComputed = computed(() => {
  let rootNode = document.documentElement;

  // 获取计算后的样式
  let computedStyle = window.getComputedStyle(rootNode);

  // 读取字体大小（注意这里返回的可能是一个包含单位的字符串，如"16px"）
  let fontSize = computedStyle.fontSize;

  // 如果你需要一个数字值（不带单位）进行计算，你可能需要解析这个字符串
  // 例如，使用正则表达式或split()方法去除单位，并将结果转换为数字
  let fontSizeNumber = parseFloat(fontSize.replace(/[^0-9.-]/g, ''));
  let heights = (fontSizeNumber / 144) * 10;
  return heights;
});
const initSetting = () => {
  const isMobile = navigator.userAgent.match(
    /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i,
  );
  nextTick(() => {
    commonStore.menuList.forEach((item) => {
      if (!item.config) {
        switch (item.type) {
          case 2:
            router.push({ name: route.meta.loopType ? 'exhibitionHome' : 'templateedit' });
            break;
        }
      }
    });
    if (isMobile) {
      router.push({ name: route.meta.loopType ? 'exhibitionHome' : 'templateedit' });
    }
  });
};
onMounted(() => {
  setTimeout(() => {
    commonStore.getMenuList();
    initSetting();
  }, 500);
});
</script>

<style lang="less" scoped>
.cultural-box {
  position: relative;
  width: 100%;
  height: 100%;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  padding: 116px 80px 58px 80px;
}
.content-door {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  cursor: pointer;
  .iconfonts {
    font-size: 26px;
    color: #fff;
    margin-bottom: 4px;
    line-height: 32px;
  }
  span {
    font-family: PingFang SC;
    font-size: 16px;
    line-height: 32px;
    color: #fff;
    margin-left: 20px;
    padding-bottom: 7px;
  }
}
.back-btn {
  position: absolute;
  top: 60px;
  left: 80px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}
.content-box {
  width: 100%;
  height: 100%;
  position: relative;
  padding: 85px 120px 60px 120px;
}
.public-name {
  position: absolute;
  top: -66px;
  left: 50%;
  transform: translateX(-50%);
  width: 370px;
  height: 116px;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 6px;
  img {
    width: 142px;
    height: 40px;
    flex-shrink: 0;
    object-fit: fill;
  }
}
.comment-box {
  width: 100%;
  margin-bottom: 30px;
}
.commentList-box {
  display: flex;
  flex-direction: column;
  //   flex: 1;
  height: 416px;
  width: 100%;
}
.commentNum {
  width: 100%;
  color: #fff;
  font-family: 'PingFang SC';
  font-size: 18px;
  font-style: normal;
  font-weight: 400;
  line-height: normal;
  margin-bottom: 14px;
}
.commentList-box-content {
  width: 100%;
  height: 100%;
}
::v-deep .unit-exbi-remarks-info-remarks {
  padding-bottom: 30px;
}
::v-deep .solid-box-parent {
  .templatestyle1-scroll-box-tumb {
    justify-content: center;
  }
  img {
    width: 18px;
    height: 18px;
  }
}
.solidBorder-child {
  width: 2px;
  height: 100%;
  background: rgba(17, 59, 172, 1);
}
</style>
